import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    loginState:0,//1表示已登录，2表示未登录
    typeState:'',//权限
    ID:''
  },
  getters: {
  },
  mutations: {
    setLogin(state,newValue){
      state.loginState=newValue
    },
    setType(state,newValue){
      state.typeState=newValue
    },
    setId(state,newValue){
      state.ID=newValue
    }
  },
  actions: {
  },
  modules: {
  },
  plugins:[
    createPersistedState({
      key:'my-app',
      paths:['loginState','typeState'],
    })
  ]
})
